<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
              <style>
        body{
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: 0;
        }
        iframe{
            width: 100%;
            height: 100%;
        }
       
    </style>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> 
    </head>
    <body>
     <iframe id="test" src='http://m.amap.com/picker/?keywords=酒店,超市,医院&key=ed0a6c645735d8187944deacdc6e30f4'></iframe>

    <script>
        (function(){
            var iframe = document.getElementById('test').contentWindow;
            setTimeout(function(){
                iframe.postMessage('hello','http://m.amap.com/picker/');
            },500);
            window.addEventListener("message", function(e){
             
    alert('您选择了:' + e.data.name + ',' + e.data.location);
            }, false);
        }());

        
    </script>

    </body>



<script type="text/javascript">
	var mock = {
		log: function(result) {
			window.parent.setIFrameResult('log', result);
		}
	};
	console = mock;
	window.Konsole = {
		exec: function(code) {
			code = code || '';
			try {
				var result = window.eval(code);
				window.parent.setIFrameResult('result', result);
			} catch (e) {
				window.parent.setIFrameResult('error', e);
			}
		}
	};
   function send(lb,name,location){
       
       
        $.ajax({
                type: "POST",
                url: "__CONTROLLER__/address/",
           
                cache: false,
                dataType: "json",
                data: {
             lb:lb,
             name:name,
             location:location
                
            },
         
                    success: function(data) {
   window.location.href="__CONTROLLER__/js_ticket/id/2";

        }
        });
   
    }  
      
</script>
</html>
